package com.baohua.service;

import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.baohua.exception.BaohuaSystemException;
import com.baohua.model.Inventory;

public interface InventoryService {
	
	/**
	 * 查询库存数据
	 * @param inventory 库存对象
	 * @param pre_priceAmount 前置总额
	 * @param af_priceAmount 后置总额
	 * @param af_inventoryAmount 后置当前库存
	 * @param pre_inventoryAmount 前置当前库存
	 * @param page
	 * @param pagesize
	 * @return
	 */
	public Map getInventoryList(Inventory inventory,String pre_priceAmount,
			   String af_priceAmount, String af_inventoryAmount, String pre_inventoryAmount, int page, int pagesize);
	
	/**
	 * 根据物料编码进行查询库存
	 * @param InventoryNO
	 * @return
	 */
	public Inventory getInventoryByNO(String InventoryNO);
	
	/**
	 * 修改物料信息
	 * @param inventory
	 * @throws BaohuaSystemException
	 */
	public void updateInventory(Inventory inventory) throws BaohuaSystemException;
	
	/**
	 * 增加物料信息
	 * @param inventory
	 * @throws BaohuaSystemException
	 */
	public void addRawMaterial(Inventory inventory) throws BaohuaSystemException;
	
	/**
	 * 根据ID查询物料信息
	 * @param InventoryID
	 * @return
	 */
	public Inventory getInventoryByID(int InventoryID);
	
	/**
	 * 根据ID删除物料信息
	 * @param id
	 * @throws BaohuaSystemException
	 */
	public void delRawMaterial(int id) throws BaohuaSystemException;
	
	/**
	 * 根据物料编码的数组, 查询库存信息
	 * @param inventoryNOs
	 * @return
	 */
	public List<Inventory> queryByInventoryNOs(String[] inventoryNOs);
	
	/**
	 * 导出数据/模板
	 * @param output 缓存输出流
	 * @param file 导出文件
	 * @param list 导出数据
	 * @param sheetName 工作薄的名字
	 * @param HttpServletRequest request Request对象
	 * @param HttpServletResponse response Response对象
	 * @throws IllegalArgumentException
	 * @throws IOException
	 * @throws IllegalAccessException
	 */
	public void exportData(String fileName, List list, String sheetName,
			 HttpServletRequest request, HttpServletResponse response)
					 throws IllegalArgumentException, 
			 IOException, IllegalAccessException;
}
